package Day08_20;

public class Test_Thread02 {
    public static void main(String[] args) {
        //2.实现Runnable
     //   MyRunnable myRunnable = new MyRunnable();
        Thread t1 = new Thread(new Runnable() { //匿名内部类 直接new 接口，再实现方法！！！！！！！
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(Thread.currentThread().getName()+"------->"+i);
                }
            }
        });
        t1.start();
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"--->"+i);
        }

    }
}
/*
class MyRunnable implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("t1"+"--->"+i);
        }
    }
}
*/